//
//  loginFootView.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/15.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "loginFootView.h"

@implementation loginFootView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        GLGWButton * forgetBut = [[GLGWButton alloc] initWithTitle:@"忘记密码" titleLableFont:SYSTEMFONT(14) titleLableColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self];
        [forgetBut mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.mas_right).offset(-kWidthProportion_In_iPhoneTriploid(30));
            make.top.equalTo(self.mas_top).offset(0);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(50)));
        }];
        forgetBut.tag = 200;
        [forgetBut addTarget:self action:@selector(footViewAction:) forControlEvents:UIControlEventTouchUpInside];
        //
        GLGWLabel * otherLoginLabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self];
        otherLoginLabel.text = @"其他登录方式";
        otherLoginLabel.textAlignment = NSTextAlignmentCenter;
        [otherLoginLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self).offset(0);
            make.bottom.equalTo(self.mas_bottom).offset(-kHeightProportion_In_iPhoneTriploid(130));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(20)));
        }];
        //
        CGFloat butlWith = (KScreenWidth - kWidthProportion_In_iPhoneTriploid(60) - kWidthProportion_In_iPhoneTriploid(80))/2;
        NSArray * imageArr = @[@"icon_qqdenglu",@"icon_weixindenglu"];
        for (int i=0; i<2; i++) {
            GLGWButton * but = [[GLGWButton alloc] initInSuperView:self];
            but.image_Name = imageArr[i];
            but.tag = 201+i;
            [but mas_makeConstraints:^(MASConstraintMaker *make) {
                make.left.equalTo(self.mas_left).offset(butlWith + kWidthProportion_In_iPhoneTriploid(40)*i +kWidthProportion_In_iPhoneTriploid(60)*i);
                make.bottom.equalTo(self.mas_bottom).offset(-kHeightProportion_In_iPhoneTriploid(68));
                make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(40)));
                make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(42)));
            }];
            [but addTarget:self action:@selector(footViewAction:) forControlEvents:UIControlEventTouchUpInside];
        }
        //
        GLGWLabel * xieYilabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self];
        [xieYilabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(17)));
            make.bottom.equalTo(self.mas_bottom).offset(-kHeightProportion_In_iPhoneTriploid(30));
        }];
        xieYilabel.attributedText = [GLGWLabel bllChangeStr:@"注册即代表您已同意《钢来钢往用户注册协议》" changewithStr:@"《钢来钢往用户注册协议》" changeColoer:[UIColor colorWithHexString:@"#666666"] withFont:SYSTEMFONT(12)];
    }
    return self;
}

-(void)footViewAction:(GLGWButton *)sender{
    if (self.Block_LoginFootView) {
        self.Block_LoginFootView(sender);
    }
}

@end
